<template>
  <div>
    <!-- 头部首页导航等信息 -->
    <!-- <Nav /> -->
    <!-- 中部容器 -->
    <div class="container">
      <!-- 头部面包屑 -->
     <Breadcrumb :MenuName="MenuName" :transmitName="'医院信息'" />
   

      <My-Menu :MenuRoutes="MenuRoutes" :code="code"></My-Menu>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref, onMounted, watch } from "vue";
import { useRoute } from "vue-router";

export default defineComponent({
  name: "Hospital",
});
</script>

<script setup lang="ts">
// import Menu from "@/components/Menu/index.vue";
import { hospitalMenuRoutes } from "@/router/routes"; //路由菜单

const MenuRoutes = ref(hospitalMenuRoutes.children); //所有子路由菜单数据

const code = ref("");

const route = useRoute(); // 获取路由器对象
const MenuName = ref(); // 点击的当前路由的name

// 监听路由切换并把名字赋值给面包屑
watch(
  () => route,
  (v) => {
    MenuName.value = v.meta.name; // 把路由改变的当前name赋值给面包屑
  },
  { deep: true, immediate: true }
);
onMounted(() => {
  // console.log("home/route:::", route.query);
  code.value = route.query.code as string;
});
</script>

<style scoped>
.container {
  margin: 0 auto;
  width: 1200px;
  min-height: 700px;
  padding: 15px 0;
  color: #7f7f7f;
}
.container >>> .el-breadcrumb {
  padding-left: 30px;
}
</style>
